// set path here
gl path "~/"

use homeowner_g g_ id year value_decile using "$path/Replication/ohio_analysis_local.dta", clear

// run regression for each home value decile
matrix B=J(10,3,.)
forvalues j=1/10 {
	reghdfe g_ homeowner_g if value_decile==`j', a(id year) cluster(id)
	matrix B[`j', 1] = _b[homeowner_g]
	matrix B[`j', 2] = `j'
}

// save matrix with coefficients and standard errors
svmat B
scatter B1 B2, xtitle("Home Value Decile") ///
	ytitle("Effect on Pr(Vote in General)") ///
	scale(1.3)

graph export "$path/Replication/figure5.pdf", replace
graph export "$path/Replication/figure5.eps", replace
